From c1ad243f8e4f38ddc9775e70519fa949235df6de Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Thu, 1 Dec 2016 23:14:09 +0000 Subject: [PATCH] Revert "m68k: move exports to definitions" This reverts commit d13ffb5630443e6112df0263969cbdfc8ab9ab57 because symbols exported from assembly don't automatically get modversions (ABI hashes). Updated for 4.11: don't revert additions of #include as it's needed for other reasons (see #862393). Gbp-Pq: Topic bugfix/m68k Gbp-Pq: Name revert-m68k-move-exports-to-definitions.patch --- arch/m68k/include/asm/export.h | 3 --- arch/m68k/kernel/Makefile | 2 +- arch/m68k/kernel/m68k_ksyms.c | 32 ++++++++++++++++++++++++++++++++ arch/m68k/lib/ashldi3.c | 2 -- arch/m68k/lib/ashrdi3.c | 2 -- arch/m68k/lib/divsi3.S | 3 --- arch/m68k/lib/lshrdi3.c | 2 -- arch/m68k/lib/modsi3.S | 3 --- arch/m68k/lib/muldi3.c | 2 -- arch/m68k/lib/mulsi3.S | 4 ++-- arch/m68k/lib/udivsi3.S | 4 ++-- arch/m68k/lib/umodsi3.S | 4 ++-- 12 files changed, 39 insertions(+), 24 deletions(-) delete mode 100644 arch/m68k/include/asm/export.h create mode 100644 arch/m68k/kernel/m68k_ksyms.c diff --git a/arch/m68k/include/asm/export.h b/arch/m68k/include/asm/export.h deleted file mode 100644 index 0af20f48bd0..00000000000 --- a/arch/m68k/include/asm/export.h +++ /dev/null @@ -1,3 +0,0 @@ -#define KSYM_ALIGN 2 -#define KCRC_ALIGN 2 -#include diff --git a/arch/m68k/kernel/Makefile b/arch/m68k/kernel/Makefile index 74c898ced8c..8a1c4d3f91c 100644 --- a/arch/m68k/kernel/Makefile +++ b/arch/m68k/kernel/Makefile @@ -13,7 +13,7 @@ extra-$(CONFIG_SUN3X) := head.o extra-$(CONFIG_SUN3) := sun3-head.o extra-y += vmlinux.lds -obj-y := entry.o irq.o module.o process.o ptrace.o +obj-y := entry.o irq.o m68k_ksyms.o module.o process.o ptrace.o obj-y += setup.o signal.o sys_m68k.o syscalltable.o time.o traps.o obj-$(CONFIG_MMU_MOTOROLA) += ints.o vectors.o diff --git a/arch/m68k/kernel/m68k_ksyms.c b/arch/m68k/kernel/m68k_ksyms.c new file mode 100644 index 00000000000..774c1bd59c3 --- /dev/null +++ b/arch/m68k/kernel/m68k_ksyms.c @@ -0,0 +1,32 @@ +#include + +asmlinkage long long __ashldi3 (long long, int); +asmlinkage long long __ashrdi3 (long long, int); +asmlinkage long long __lshrdi3 (long long, int); +asmlinkage long long __muldi3 (long long, long long); + +/* The following are special because they're not called + explicitly (the C compiler generates them). Fortunately, + their interface isn't gonna change any time soon now, so + it's OK to leave it out of version control. */ +EXPORT_SYMBOL(__ashldi3); +EXPORT_SYMBOL(__ashrdi3); +EXPORT_SYMBOL(__lshrdi3); +EXPORT_SYMBOL(__muldi3); + +#if defined(CONFIG_CPU_HAS_NO_MULDIV64) +/* + * Simpler 68k and ColdFire parts also need a few other gcc functions. + */ +extern long long __divsi3(long long, long long); +extern long long __modsi3(long long, long long); +extern long long __mulsi3(long long, long long); +extern long long __udivsi3(long long, long long); +extern long long __umodsi3(long long, long long); + +EXPORT_SYMBOL(__divsi3); +EXPORT_SYMBOL(__modsi3); +EXPORT_SYMBOL(__mulsi3); +EXPORT_SYMBOL(__udivsi3); +EXPORT_SYMBOL(__umodsi3); +#endif diff --git a/arch/m68k/lib/ashldi3.c b/arch/m68k/lib/ashldi3.c index ac08f814139..716785f59ae 100644 --- a/arch/m68k/lib/ashldi3.c +++ b/arch/m68k/lib/ashldi3.c @@ -14,7 +14,6 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. */ #include -#include #define BITS_PER_UNIT 8 @@ -58,4 +57,3 @@ __ashldi3 (DItype u, word_type b) return w.ll; } -EXPORT_SYMBOL(__ashldi3); diff --git a/arch/m68k/lib/ashrdi3.c b/arch/m68k/lib/ashrdi3.c index 5837b1dd333..7f1ef8e5a21 100644 --- a/arch/m68k/lib/ashrdi3.c +++ b/arch/m68k/lib/ashrdi3.c @@ -14,7 +14,6 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. */ #include -#include #define BITS_PER_UNIT 8 @@ -59,4 +58,3 @@ __ashrdi3 (DItype u, word_type b) return w.ll; } -EXPORT_SYMBOL(__ashrdi3); diff --git a/arch/m68k/lib/divsi3.S b/arch/m68k/lib/divsi3.S index 3a2143f5163..2c0ec85ac66 100644 --- a/arch/m68k/lib/divsi3.S +++ b/arch/m68k/lib/divsi3.S @@ -33,8 +33,6 @@ General Public License for more details. */ D. V. Henkel-Wallace (gumby@cygnus.com) Fete Bastille, 1992 */ -#include - /* These are predefined by new versions of GNU cpp. */ #ifndef __USER_LABEL_PREFIX__ @@ -120,4 +118,3 @@ L2: movel d1, sp@- L3: movel sp@+, d2 rts - EXPORT_SYMBOL(__divsi3) diff --git a/arch/m68k/lib/lshrdi3.c b/arch/m68k/lib/lshrdi3.c index 7f40566be6c..1094343a8a2 100644 --- a/arch/m68k/lib/lshrdi3.c +++ b/arch/m68k/lib/lshrdi3.c @@ -14,7 +14,6 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. */ #include -#include #define BITS_PER_UNIT 8 @@ -58,4 +57,3 @@ __lshrdi3 (DItype u, word_type b) return w.ll; } -EXPORT_SYMBOL(__lshrdi3); diff --git a/arch/m68k/lib/modsi3.S b/arch/m68k/lib/modsi3.S index 1c967649a4e..1d9e0efdf31 100644 --- a/arch/m68k/lib/modsi3.S +++ b/arch/m68k/lib/modsi3.S @@ -33,8 +33,6 @@ General Public License for more details. */ D. V. Henkel-Wallace (gumby@cygnus.com) Fete Bastille, 1992 */ -#include - /* These are predefined by new versions of GNU cpp. */ #ifndef __USER_LABEL_PREFIX__ @@ -108,4 +106,3 @@ SYM (__modsi3): movel d1, d0 rts - EXPORT_SYMBOL(__modsi3) diff --git a/arch/m68k/lib/muldi3.c b/arch/m68k/lib/muldi3.c index 3fb05c698c4..9dabae593da 100644 --- a/arch/m68k/lib/muldi3.c +++ b/arch/m68k/lib/muldi3.c @@ -15,7 +15,6 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. */ #include -#include #ifdef CONFIG_CPU_HAS_NO_MULDIV64 @@ -93,4 +92,3 @@ __muldi3 (DItype u, DItype v) return w.ll; } -EXPORT_SYMBOL(__muldi3); diff --git a/arch/m68k/lib/mulsi3.S b/arch/m68k/lib/mulsi3.S index 855675e69a8..c39ad4e738e 100644 --- a/arch/m68k/lib/mulsi3.S +++ b/arch/m68k/lib/mulsi3.S @@ -32,7 +32,7 @@ General Public License for more details. */ Some of this code comes from MINIX, via the folks at ericsson. D. V. Henkel-Wallace (gumby@cygnus.com) Fete Bastille, 1992 */ -#include + /* These are predefined by new versions of GNU cpp. */ #ifndef __USER_LABEL_PREFIX__ @@ -102,4 +102,4 @@ SYM (__mulsi3): addl d1, d0 rts - EXPORT_SYMBOL(__mulsi3) + diff --git a/arch/m68k/lib/udivsi3.S b/arch/m68k/lib/udivsi3.S index 78440ae513b..35a5446572a 100644 --- a/arch/m68k/lib/udivsi3.S +++ b/arch/m68k/lib/udivsi3.S @@ -32,7 +32,7 @@ General Public License for more details. */ Some of this code comes from MINIX, via the folks at ericsson. D. V. Henkel-Wallace (gumby@cygnus.com) Fete Bastille, 1992 */ -#include + /* These are predefined by new versions of GNU cpp. */ #ifndef __USER_LABEL_PREFIX__ @@ -154,4 +154,4 @@ L2: subql IMM (1),d4 unlk a6 | and return rts #endif /* __mcf5200__ || __mcoldfire__ */ - EXPORT_SYMBOL(__udivsi3) + diff --git a/arch/m68k/lib/umodsi3.S b/arch/m68k/lib/umodsi3.S index b6fd11f5894..099da514a8f 100644 --- a/arch/m68k/lib/umodsi3.S +++ b/arch/m68k/lib/umodsi3.S @@ -32,7 +32,7 @@ General Public License for more details. */ Some of this code comes from MINIX, via the folks at ericsson. D. V. Henkel-Wallace (gumby@cygnus.com) Fete Bastille, 1992 */ -#include + /* These are predefined by new versions of GNU cpp. */ #ifndef __USER_LABEL_PREFIX__ @@ -105,4 +105,4 @@ SYM (__umodsi3): subl d0, d1 /* d1 = a - (a/b)*b */ movel d1, d0 rts - EXPORT_SYMBOL(__umodsi3) + -- 2.30.2